﻿using System;
using System.Collections.Generic;
using System.Text;
using Lon.Util;
using System.Threading;

namespace NetDebugConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            String ip;
            if (args.Length < 1)
            {
                Console.WriteLine("请输入IP地址");
                return;
            }
            ip = args[0];
            NetDebugConsoleTerminal ter = new NetDebugConsoleTerminal(ip);
            ter.MessageOut=new ConsoleOut();
            ter.Init();
          
            while (true)
            {
                Thread.Sleep(2000);
                Console.Write("\r\nNetDebugConsole:");
                String cmd = Console.ReadLine();
                if (cmd == "exit")
                {
                    break;
                }
                if (String.IsNullOrEmpty(cmd))
                {
                    continue;
                }
                ter.Send(cmd+"\r\n");
                
            }

        }
    }
    class ConsoleOut:IMessageOuter
    {

        #region IMessageOuter 成员

        public void ShowText(string text)
        {
            Console.Write(text);
        }

        #endregion
    }
}
